package com.lagou.rocketmq.listener;


import com.alibaba.fastjson.JSON;
import com.lagou.rocketmq.pojo.Order;
import org.apache.rocketmq.common.message.Message;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

//@Component
//@RocketMQMessageListener(topic = "pay_timeout", consumerGroup = "consumer1")
public class OrderProcessListener implements RocketMQListener<Message> {

    @Override
    public void onMessage(Message message) {

        Order order = JSON.parseObject(new String(message.getBody()), Order.class);

        System.out.println(order);
    }
}
